import {createApp} from 'vue'
import App from './App.vue'
import axios from 'axios'
import router from "./router";
import './assets/css/global.css'

// 请求根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
// axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
axios.interceptors.request.use(config => {
    // 请求拦截器
    config.headers['Authorization'] = sessionStorage.getItem('token')
    // 需要返回config
    // console.log(config)
    return config;
}, error => {
    console.log(error)
})
const app = createApp(App)

app.use(router)

app.mount('#app')
